<template>
  <div class="basic-info">
    <div class="info-content" v-loading="loading">
      <div class="info-list">
        <div class="info-row" v-for="item in userInfo" :key="item.label">
          <span class="info-label">{{ item.label }}：</span>
          <span class="info-value">{{ item.value }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { getPermissionInfo } from '@/api/portal'

const userInfo: any = ref([])
const loading = ref(false)

onMounted(() => {
  loading.value = true
  getPermissionInfo().then((res) => {
    if (res) {
      loading.value = false
      userInfo.value = [
        { label: '用户名', value: res.nickName || '未填写' },
        { label: '电话', value: res.telePhone || '未填写' },
        { label: '微信号', value: res.wechat || '未填写' },
        { label: '邮箱', value: res.email || '未填写' }
      ]
    }
  })
})
</script>

<style scoped>
.basic-info {
  .info-content {
    background: white;
    padding: 32px;
    /* border-radius: 12px; */
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); */
  }

  .info-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .info-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 8px;
    /* border-left: 3px solid #1890ff; */
    transition: all 0.2s ease;

    &:hover {
      background: #e6f7ff;
      transform: translateX(4px);
    }
  }

  .info-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    min-width: 80px;
  }

  .info-value {
    font-size: 16px;
    color: #1e293b;
    font-weight: 600;
    margin-left: 12px;
  }
}
</style>
